// 引入依赖
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate'

// 引入饿了么框架
import ElementPlus from 'element-plus'
import locale from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'

// 引入样式文件
import './assets/font/iconfont.css'
import './assets/css/common.scss'

// 引入根组件
import App from './App.vue'

// 注入方法
import router from './router'
import system from './utils/system'
import global from './utils/global'
import request from './utils/request'
import service  from './utils/service'

// 在主进程文件顶部添加
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true

// 定义全局方法
const app = createApp(App)
app.config.globalProperties.$system = system
app.config.globalProperties.$global = global
app.config.globalProperties.$request = request
app.config.globalProperties.$service = service

app.provide('global', global);


// 状态管理, 框架中文化
const pinia = createPinia()
const persist = createPersistedState()
pinia.use(persist)
app.use(pinia)
app.use(ElementPlus, {locale})

// 程序启动
app.use(router).mount('#app')
